import request from '@/utils/request'

export function login(params) {
  return request({
    url: '/api/login',
    method: 'get',
    params
  })
}

export function getInfo(token) {
  return request({
    url: '/api/detail',
    method: 'get',
    params: { token }
  })
}


export function getPageData(params) {
  return request({
    url: '/api/user/list',
    method: 'post',
    data: params
  })
}

export function getData(params) {
  return request({
    url: '/api/user/one/',
    method: 'get',
    params:params
  })
}

export function addData(params) {
  return request({
    url: '/api/user/add',
    method: 'post',
    data: params
  })
}

export function updateData(params) {
  return request({
    url: '/api/user/update',
    method: 'post',
    data: params
  })
}

export function deleteData(id) {
  return request({
    url: '/api/user/'+id,
    method: 'delete'
  })
}
